# _*_ utf-8 _*_
# 使用顺序遍历列表查找元素
lst_name = ["刘备", "关羽", "张飞", "曹操", "于禁", "夏侯惇", "孙权", "黄盖"]
search_name = input("请输入要查找的英雄名称：")
search_index = -1
for index in range(len(lst_name)):
    if search_name == lst_name[index]:
        search_index = index
        break
if search_index != -1:
    print("要查找英雄：{}的下标为：{}".format(search_name, search_index))
else:
    print("未找到你要查找的英雄，请重试！")


